import { request } from '@umijs/max';

// 文件上传
export async function ApiUpload(body: { file: any }) {
  return request<API.Result_Upload_>('/upload', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    skipErrorHandler: true,
  });
}

// 分析
export async function ApiMain(body: API.Main) {
  return request<API.Result_Main_>('/main', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
  });
}

// 列表
export async function ApiQueryList(body: API.PageInfo) {
  return request<API.Result_list>('/get_total_records', {
    method: 'post',
    data: body,
    isMock: true,
  });
}

// 详情
export async function ApiQueryOne(body: API.Item) {
  return request<API.Result_One>('/get_one_record', {
    method: 'post',
    data: body,
  });
}
